//
//  XMWithdrawDetailViewController.m
//  XMJJ_zml
//
//  Created by apple on 2025/5/16.
//

#import "XMWithdrawDetailViewController.h"
#import "XMWithdrawDetailView.h"
#import "XMNetwork+mine.h"
#import "XMWithdrawModel.h"

@interface XMWithdrawDetailViewController ()

@property (nonatomic, strong) XMWithdrawDetailView *withdrawView;

@property (nonatomic, assign) NSInteger page;

@end

@implementation XMWithdrawDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self creatUI];
}

- (void)creatUI {
    [self.view addSubview:self.withdrawView];
    [self getWithdrawRecord];
}

//提现记录
- (void)getWithdrawRecord {
    XMWeakSelf;
    [_Network getWithdrawRecordWithPage:[NSString stringWithFormat:@"%ld", _page]
                                success:^(id  _Nonnull responseObject) {
        NSArray *withdrawModelArr = [NSArray yy_modelArrayWithClass:[XMWithdrawModel class] json:[responseObject safeArrayForKey:@"data"]];
        [weakSelf.withdrawView setContentWithWithdrawDetailModelArr:withdrawModelArr page:weakSelf.page];
    } failure:^(NSError * _Nonnull error) {
        
    }];
}

#pragma mark - Init
- (XMWithdrawDetailView *)withdrawView {
    if (!_withdrawView) {
        _withdrawView = [[XMWithdrawDetailView alloc] initWithFrame:self.view.bounds];
    }
    return _withdrawView;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
